home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 24
/
024.d81
/
speed boat
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
4KB
|
115 lines
35 printchr$(142):forj=0to63:readi:poke12288+j,i:next:rem read in sprite data
40 poke2040,192:v=53248:pokev+39,2
65 poke53280,5:poke53281,14:pokev+29,0
70 print"[147][158]"tab(10)" speed boat race"
75 print"[144]score is elapsed time +5 for each gate missed. lowest score wins."
80 :
90 print"[144]press [158]<[144] to go left, [158]>[144] to go right."
95 print"try to go through all gates[160][150][167][190][164][164][164][164][164][188][165]"
100 print"[155]and make all jumps [158][169] [223][146][155]that you can."
105 print"[144]hitting an island will cause a delay!"
110 print"[158]no. of players (1-4) ";
112 getnp$:ifnp$<"1"ornp$>"4"then112
113 np=val(np$)
114 printnp
115 print"no. of rounds (1-5) ";
116 getnr$:ifnr$<"1"ornr$>"5"then116
117 nr=val(nr$)
119 print nr
120 r=1:p=1:print" player #";p:m$="[158]"
130 printm$"player"p"-- select skill level desired:"
135 print"1=beginner":print"2=intermediate"
140 print"3=advanced":print"4=olympic":print"5=professional"
150 a$="":geta$
160 ifa$="1"thens$=" beginner":goto210
170 ifa$="2"thens$="intermediate":goto210
175 ifa$="3"thens$=" advanced":goto210
180 ifa$="4"thens$=" olympic":goto210
185 ifa$="5"thens$="professional":goto210
190 c1=c1+1:ifc1=20thenc1=0
195 ifc1=10thenm$="[154]"
200 ifc1=19thenm$="[158]"
205 print"[145][145][145][145][145][145][145][145]":goto130
210 sk=val(a$):rn=(sk+1)/10
215 ifsk<1orsk>5orsk<>int(sk)thenprint"[145][145][145][145][145][145][145][145][145][145]":goto130
220 sk=35-5*sk
230 print"[147]":s=54272
240 fori=1to12step2
245 l=int(rnd(1)*38)+.5:printtab(l);"[153][166][220][166][166][145]":next
250 b=1484:c=54272:pokeb,28:pokeb+c,14:pokeb+37,32:pokeb+38,32:pokeb+40,32
260 poke1475,106:poke1476,126:poke1475+c,10:poke1476+c,10:rem flags
265 poke1490,124:poke1491,116:poke1490+c,10:poke1491+c,10
270 print"[158]";s$;" [146]"
275 x1=175:pokev+1,125:pokev,x1:pokev+21,1
300 geta$:ifa$=""then300
310 ti$="000000"
315 gosub830:rem turn on sound
320 rem start of action
340 b=b+d:pokeb,f:pokeb+c,14
345 ifpeek(197)<>64then350
347 d=0:f=28:pokeb-41,73:pokeb+c-41,3:pokeb-39,85:pokeb+c-39,3
350 ifpeek(197)<>47then355
352 d=-1:f=28:pokeb-41,73:pokeb+c-41,3:pokeb-39,85:pokeb+c-39,3
355 ifpeek(197)<>44then357
356 d=+1:f=28:pokeb-41,73:pokeb+c-41,3:pokeb-39,85:pokeb+c-39,3
357 x1=x1+(d*8):ifx1>255thenpokev+16,1:pokev,x1-255:goto360
358 pokev+16,0:pokev,x1
360 pokeb,32
365 ifskthenfort=1tosk:next
370 g=g+1:ifg<28then410
380 g=0:e=e+1:ife=10thenprint"======================================="
390 ife=10thenprint"=======================================":goto470
400 x=int(rnd(1)*25)+2:printtab(x)"[150][167][190][154][164][164][164][164][164][164][164][150][188][180]":goto470:rem print gates
410 ifg=10thenx=int(rnd(1)*30)+4:printtab(x)"[158][169] [223]":rem jump ramp
420 ifrnd(1)>rnthen440
430 l=int(rnd(1)*30)+1:printtab(l)"[153][168][157][157][166][166][145]":goto450
440 print:rem print blank line
450 ifpeek(b)<>32then500:rem test for collision
470 goto320
490 rem what did boat collide with?:
500 ifpeek(b)=100thenh=h+1:fort=1to30:next:goto470:rem goes thru a gate
510 ifpeek(b)=61thenh=9-h:tm=int(ti/60):pokev+21,0:goto640:rem finish line
520 ifpeek(b)=124orpeek(b)=126thenpokeb-40,91:goto600:rem hits a flag
530 ifpeek(b)<>160andpeek(b)<>223andpeek(b)<>233then580:rem hit a jump ramp
540 g=g+10:gosub805:gosub870:gosub830:ifsk>0thensk=sk-2
560 goto470
580 ifpeek(b)=92orpeek(b)=102thenpokeb-40,91:goto600:rem hits an island
590 goto470
600 gosub805:gosub850:forj=2to0step-1:fori=5-jto5+j:poke53267,i:nexti,j
610 os=os+1:fort=0to127:pokeb-40+c,int(t/40)+2:next
630 gosub805:gosub830:goto470
640 gosub810:rem shut off sound
650 u=0:print"[147] objects hit=";os:print" gates missed=";h
655 print" time="tm :sc=tm+5*h
660 print" score="sc
670 z(p)=z(p)+sc:print" round ";r:print" ":fori=1tonp
680 print" player #";i;z(i):next
690 sc=0:g=0:e=0:os=0:h=0:ifu=10thenu=0:goto130
700 p=p+1:ifp<np+1then130
710 r=r+1:ifr<nr+1thenp=1:goto130
720 print" game over "
725 poke198,0
730 print"[158]do you wish to play again (y/n)"
735 getb$:ifb$<>"y"andb$<>"n" then735
740 ifb$="y"thenz(1)=0:goto70
750 print"[147] goodbye! "
760 fort=1to3000:next:print"[147][144]":poke53280,0:poke53281,0:load"hello connect",8
800 rem ****sound routines****
805 rem clear sound registers
810 forj=1to24:pokes+j,0:next:return
830 rem sound of wind
835 pokes+24,5:pokes+5,128:pokes+6,128:pokes+1,40
840 pokes+4,128:pokes+4,129:return
850 rem sound of crash
855 pokes+24,15:pokes+5,28:pokes+1,20:pokes+4,128:pokes+4,129:return
870 rem jump routine
875 pokes+24,15:pokes+5,12*16+0:pokes+6,12*16+10
880 forj=200to100step-1:pokes+1,j:pokes+4,17
885 r1=r1+1:ifr1=8thengosub895
890 next:pokes+24,0:return
895 print:r1=0:return
900 data0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
905 data0,127,0,0,255,128,0,193,128,0,193,128,0,193,128
910 data0,193,128,0,193,128,0,193,128,0,193,128,0,255,128
915 data0,127,0,0,62,0,0,28,0,0,8,0,0